package cn.lyvust.shili01;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class ScriptEngineTest {
    public static void main(String[] args) {
        ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript");
        try {
            System.out.println("1234".indexOf("3"));

//            int num1 = 3;
//            int num2 = 8;
//            System.out.println(num1 + num2);

            Object obj = se.eval("3-5");
            System.out.println(obj);
        } catch (ScriptException e) {
            e.printStackTrace();
        }

    }
}
